
/**
 *
 */

const vnode = {}

const _render = (vnode) => {
    let vdom = null
    if (typeof vnode === 'string') {
        vdom = String(vnode);
    }
    if (typeof vnode === 'number') {
        vdom = document.createTextNode(vnode);
    }

    vdom = document.createElement(vnode.tag);

    if (vnode.attrs) {
        Object.keys(vnode.attrs).forEach((item, key) => {
            const value = vnode.attrs[item]
            vdom.setAttribute(item, value)
        })
    }
    
    vnode.children.forEach(child => vdom.appendChild(_render(child)))

    return vnode;
}



